package com.wxj.bank.module.enums;

import org.apache.commons.lang3.StringUtils;

public enum OrderState {

    PAID(0,"已付款"),
    EFFECTIVE_ORDER(1,"生成有效订单"),
    SHIPPED(2,"已发货"),
    FINASHED(3,"已完成")
    ;

    private final int code;
    private final String comment;

    OrderState(int code,String comment){
        this.code = code;
        this.comment = comment;
    }

    public static OrderState orderState(int code){
        for(OrderState state:values()){
            if(state.getCode() == code){
                return state;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getComment() {
        return comment;
    }
}
